// 商户端模拟数据文件

// 商品分类数据
export const goodsCategories = [
  { id: 1, name: '快餐', sort: 1  },
  { id: 2, name: '饮品', sort: 2  },
  { id: 3, name: '小吃', sort: 3  },
  { id: 4, name: '甜品', sort: 4  },
  { id: 5, name: '套餐', sort: 5  }
];

// 订单列表数据 - 商户端视角
export const merchantOrderList = [
  // 待处理订单
  {
    id: 'DD20230007',
    customerId: 1,
    customerName: '校园用户',
    customerAvatar: 'https://picsum.photos/200/200?random=100',
    customerPhone: '138****8888',
    status: 2,
    statusText: '待接单',
    createTime: '2023-06-10 11:30:45',
    payTime: '2023-06-10 11:31:20',
    deliveryTime: '2023-06-10 13:00:00',
    totalPrice: 38,
    deliveryFee: 2,
    discount: 5,
    actualPay: 38,
    deliveryType: 1,
    deliveryAddress: '学生宿舍 B栋304',
    remark: '',
    goods: [
      {
        id: 2,
        name: '鱼香肉丝饭',
        price: 16,
        image: 'https://picsum.photos/200/200?random=11',
        specifications: '[{"name":"分量","value":"大份","price":3},{"name":"米饭","value":"多饭","price":1}]',
        quantity: 1,
        subtotal: 16
      },
      {
        id: 12,
        name: '小笼包',
        price: 10,
        image: 'https://picsum.photos/200/200?random=21',
        specifications: '',
        quantity: 2,
        subtotal: 20
      }
    ],
    // 商户端特有字段
    canAccept: true,
    canReject: true,
    acceptTime: null,
    rejectTime: null,
    rejectReason: null
  },
  {
    id: 'DD20230008',
    customerId: 2,
    customerName: '测试用户',
    customerAvatar: 'https://picsum.photos/200/200?random=101',
    customerPhone: '139****9999',
    status: 2,
    statusText: '待接单',
    createTime: '2023-06-10 15:20:30',
    payTime: '2023-06-10 15:21:00',
    deliveryTime: '2023-06-10 13:00:00',
    totalPrice: 34,
    deliveryFee: 1,
    discount: 4,
    actualPay: 34,
    deliveryType: 1,
    deliveryAddress: '第一教学楼 301教室',
    remark: '多加珍珠',
    goods: [
      {
        id: 3,
        name: '珍珠奶茶',
        price: 12,
        image: 'https://picsum.photos/200/200?random=12',
        specifications: '[{"name":"分量","value":"大杯","price":3},{"name":"糖度","value":"全糖","price":0},{"name":"冰度","value":"正常冰","price":0}]',
        quantity: 2,
        subtotal: 24
      },
      {
        id: 14,
        name: '蛋挞',
        price: 6,
        image: 'https://picsum.photos/200/200?random=23',
        specifications: '',
        quantity: 2,
        subtotal: 12
      }
    ],
    // 商户端特有字段
    canAccept: true,
    canReject: true,
    acceptTime: null,
    rejectTime: null,
    rejectReason: null
  },
  
  // 进行中订单
  {
    id: 'DD20230009',
    customerId: 1,
    customerName: '校园用户',
    customerAvatar: 'https://picsum.photos/200/200?random=100',
    customerPhone: '138****8888',
    status: 3,
    statusText: '配送中',
    createTime: '2023-06-10 11:45:45',
    payTime: '2023-06-10 11:46:20',
    deliveryTime: '2023-06-10 12:30:00',
    totalPrice: 42,
    deliveryFee: 2,
    discount: 5,
    actualPay: 42,
    deliveryType: 1,
    deliveryAddress: '学生宿舍 B栋304',
    remark: '加辣',
    goods: [
      {
        id: 1,
        name: '红烧牛肉面',
        price: 15,
        image: 'https://picsum.photos/200/200?random=10',
        specifications: '[{"name":"分量","value":"大份","price":3},{"name":"辣度","value":"特辣","price":0}]',
        quantity: 2,
        subtotal: 30
      },
      {
        id: 11,
        name: '手工水饺',
        price: 12,
        image: 'https://picsum.photos/200/200?random=20',
        specifications: '',
        quantity: 1,
        subtotal: 12
      }
    ],
    // 商户端特有字段
    canAccept: false,
    canReject: false,
    acceptTime: '2023-06-10 11:50:00',
    rejectTime: null,
    rejectReason: null,
    riderInfo: {
      name: '张师傅',
      phone: '13900139000',
      location: '食堂一楼'
    }
  },
  
  // 历史订单
  {
    id: 'DD20230001',
    customerId: 1,
    customerName: '校园用户',
    customerAvatar: 'https://picsum.photos/200/200?random=100',
    customerPhone: '138****8888',
    status: 4,
    statusText: '已完成',
    createTime: '2023-06-01 11:30:45',
    payTime: '2023-06-01 11:31:20',
    deliveryTime: '2023-06-10 12:30:00',
    finishTime: '2023-06-01 12:00:00',
    totalPrice: 32,
    deliveryFee: 2,
    discount: 5,
    actualPay: 32,
    deliveryType: 2,
    deliveryAddress: '',
    remark: '加辣',
    goods: [
      {
        id: 2,
        name: '鱼香肉丝饭',
        price: 16,
        image: 'https://picsum.photos/200/200?random=11',
        specifications: '[{"name":"分量","value":"大份","price":3},{"name":"米饭","value":"多饭","price":1}]',
        quantity: 1,
        subtotal: 16
      },
      {
        id: 12,
        name: '小笼包',
        price: 10,
        image: 'https://picsum.photos/200/200?random=21',
        specifications: '',
        quantity: 2,
        subtotal: 20
      }
    ],
    // 商户端特有字段
    canAccept: false,
    canReject: false,
    acceptTime: '2023-06-01 11:35:00',
    rejectTime: null,
    rejectReason: null,
    riderInfo: {
      name: '李师傅',
      phone: '13900139001',
      location: '食堂一楼'
    },
    customerRating: 5,
    customerComment: '味道很好，配送也很快'
  }
];

// 商户信息
export const merchantInfo = {
  id: 1,
  name: '食堂一楼',
  logo: 'https://picsum.photos/200/200?random=1',
  canteen_id: 1,
  rating: 4.8,
  base_time: 15,
  min_price: 15,
  delivery_fee: 2,
  sales: 1023,
  address: '校内食堂一楼',
  phone: '13800138000',
  latitude: 30.123456,
  longitude: 120.123456,
  status: 1,
  close_method: 0,
  businessHoursList: [
    { startTime: '07:00', endTime: '09:30', weekdays: '1111100' },
    { startTime: '11:00', endTime: '13:30', weekdays: '1111100' },
    { startTime: '17:00', endTime: '20:00', weekdays: '1111100' }
  ],
  supportDelivery: true,
  supportDineIn: true,
  supportTakeout: true,
  // 商户端特有字段
  todayOrderCount: 15,
  todayIncome: 568.5,
  monthlyIncome: 12568.5,
  pendingOrderCount: 2,
  processingOrderCount: 3
};

// 商品列表 - 商户端视角
export const merchantGoodsList = [
  {
    id: 1,
    name: '红烧牛肉面',
    price: 15,
    originalPrice: 18,
    image: 'https://picsum.photos/200/200?random=10',
    description: '精选牛肉，配以秘制红烧汤底，口感浓郁，面条劲道',
    sales: 342,
    rating: 4.8,
    categoryId: 1,
    status: 1, // 1: 上架, 0: 下架
    stock: 50,
    specifications: [
      {
        name: '分量',
        options: [
          { id: 1, name: '小份', price: 0 },
          { id: 2, name: '大份', price: 3 }
        ]
      },
      {
        name: '辣度',
        options: [
          { id: 3, name: '不辣', price: 0 },
          { id: 4, name: '微辣', price: 0 },
          { id: 5, name: '中辣', price: 0 },
          { id: 6, name: '特辣', price: 0 }
        ]
      }
    ]
  },
  {
    id: 11,
    name: '手工水饺',
    price: 12,
    originalPrice: 15,
    image: 'https://picsum.photos/200/200?random=20',
    description: '现包现煮，皮薄馅大，口感鲜美',
    sales: 234,
    rating: 4.7,
    categoryId: 1,
    status: 1,
    stock: 30,
    specifications: []
  }
];

// 经营数据
export const businessData = {
  overview: {
    orderCount: 42,
    totalIncome: 12600
  },
  charts: {
    orderTrend: {
      xAxis: ['周一','周二','周三','周四','周五','周六','周日'],
      series: [35,42,38,45,47,50,48]
    },
    hotGoods: {
      yAxis: ['红烧牛肉面','香辣鸡腿堡','珍珠奶茶','薯条','炸鸡翅'],
      series: [128,115,98,87,76]
    }
  }
};